import { pubRequire } from '@utils/public'
const baseUrl = '/posts'
/* 岗位管理获取列表 */
export function getSearchList(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}`, obj, callbBack, errBack)
}
/* 批量删除*/
export function batchRemove(obj, callbBack, errBack) {
  return pubRequire('delete', `${baseUrl}/batchRemove`, obj, callbBack, errBack)
}
/* 单个删除*/
export function deleteReq(postId, callbBack, errBack) {
  return pubRequire(
    'delete',
    `${baseUrl}/${postId}`,
    postId,
    callbBack,
    errBack
  )
}
/*编辑时获取表单详情*/
export function getForm(postId, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/${postId}`, '', callbBack, errBack)
}
/* 校验岗位编码 */
export function postCode(id, obj, callbBack, errBack) {
  return pubRequire(
    'get',
    `${baseUrl}/${id}/verification-post-code`,
    obj,
    callbBack,
    errBack
  )
}
/* 校验岗位名称 */
export function postName(id, obj, callbBack, errBack) {
  return pubRequire(
    'get',
    `${baseUrl}/${id}/verification-post-name`,
    obj,
    callbBack,
    errBack
  )
}
/*新增表单提交*/
export function addPosts(obj, callbBack, errBack) {
  return pubRequire('post', `${baseUrl}`, obj, callbBack, errBack)
}
/*编辑表单提交*/
export function editPosts(postId, obj, callbBack, errBack) {
  return pubRequire('put', `${baseUrl}/${postId}`, obj, callbBack, errBack)
}
